package com.cseg674.datamanagement.adler;

/**
 * Interface for inserting RDF/XML data for Java projects into the Adler database.
 */
public interface DataInserter 
{
   /**
    * Inserts data into the specified project.
    *
    * @param project        The name of the project to insert data into. 
    * @param semanticData   The semantic data to insert into the project in
    *                       one of the formats specified by dataLanguage.
    * @param baseURI        The URI for the ontology.
    * @param dataLanguage   Format of semanticData. Supported formats:
    *                       "RDF/XML", "N-TRIPLE", "N3", and 'null'. 
    *                       'null' is equiv. to "RDF/XML".
    * @throws AdlerException
    */
    void insertProject(String project, String semanticData, String baseURI,
        String dataLanguage) throws AdlerException;

   /**
    * Replace a specified project with all new data. If the project does not
    * exist, a new project with the provided semantic data will be created.
    *
    * @param project        The name of the project to insert data into. 
    * @param semanticData   The semantic data to insert into the project in
    *                       one of the formats specified by dataLanguage.
    * @param baseURI        The URI for the ontology.
    * @param dataLanguage   Format of semanticData. Supported formats:
    *                       "RDF/XML", "N-TRIPLE", "N3", and 'null'. 
    *                       'null' is equiv. to "RDF/XML".
    * @throws AdlerException
    */
    void replaceProject(String project, String semanticData, String baseURI,
        String dataLanguage) throws AdlerException;

   /**
    * Delete all semantic data for a particular project.
    *
    * @param  project           The name of the project to insert data into
    * @throws AdlerException
    */
    void deleteProject(String project) throws AdlerException;

   /**
    * Retrieve the ontology URI for a particular project. Currently, this only
    * supports one ontology, but the project name is provided here for future
    * implementation that can support multiple ontologies.
    *
    * @param  project   name of the project whose ontology is sought
    * @return           string of the ontology URI
    */
    String getOntologyURI(String project) throws AdlerException;
}